package com.dxy.user.controller;

import com.dxy.common.pojo.Group;
import com.dxy.common.vo.Result;
import com.dxy.user.service.GroupService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class GroupController {

    @Autowired
    private GroupService groupService;

    @GetMapping("/findUserGroup/{userId}")
    public Result<List<Group>> findUserGroup(@PathVariable("userId")Integer userId) {
        List<Group> groupList = groupService.findUserGroup(userId);
        return Result.ok(groupList);
    }
}
